package org.apm.data.bean;

import org.elasticsearch.action.bulk.BulkProcessor;
import org.elasticsearch.client.Client;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.search.SearchHit;

public abstract class ScrollBean {
    private Client client;
    private BulkProcessor bulkProcessor;
    private String index;
    private String dst_index;
    private QueryBuilder query;

    private int scroll_time = 60000;
    private int scroll_size = 1000;

    public ScrollBean(final Client client, final BulkProcessor bulkProcessor, final String index, final QueryBuilder query) {
        this.client = client;
        this.bulkProcessor = bulkProcessor;
        this.index = index;
        this.query = query;
    }

    public Client getClient() {
        return client;
    }

    public BulkProcessor getBulkProcessor() {
        return bulkProcessor;
    }

    public String getIndex() {
        return index;
    }

    public String getDst_index() {
        return dst_index;
    }

    public void setDst_index(String dst_index) {
        this.dst_index = dst_index;
    }

    public QueryBuilder getQuery() {
        return query;
    }

    public int getScroll_time() {
        return scroll_time;
    }

    public void setScroll_time(int scroll_time) {
        this.scroll_time = scroll_time;
    }

    public int getScroll_size() {
        return scroll_size;
    }

    public void setScroll_size(int scroll_size) {
        this.scroll_size = scroll_size;
    }

    public abstract void processData(SearchHit hit);
}
